package com.lzy.liujing.restaurant.dao;

import com.lzy.liujing.restaurant.entity.GoodsCategory;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created with IDEA
 * author:LiuJing
 * Date:2018/10/1
 * Time:23:36
 */
@Mapper
public interface GoodsCategoryDao {

    @Select("select * from r_category")
    List<GoodsCategory> selectAll();

    @Select("select * from r_category ")
    List<GoodsCategory> findPage(GoodsCategory query);

    @Delete("delete from r_category where category_id =#{categoryId}")
    int delete(Integer id);

    @Insert("insert into r_category (category_name) values(#{categoryName} )")
    int insert(GoodsCategory brand);

    @Update("update r_category set category_name = #{categoryName} where category_id = #{categoryId}")
    int update(GoodsCategory brand);

    @Select("SELECT * FROM r_category WHERE category_id = #{categoryId}")
    GoodsCategory getById(Integer id);
}
